﻿using MediatR;
using S.Produce.Domains;
using S.Produce.Infrastructure;
using S.Produce.Read.Api.Application.Commands.ShiftCommands;

namespace S.Produce.Read.Api.Application.CommandHandlers.ShiftCommandHandlers
{
    public class ShiftBackfillCommandHandler : IRequestHandler<ShiftBackfillCommand, ShiftDorm>
    {
        private readonly IRepository<ShiftDorm> _repository;

        public ShiftBackfillCommandHandler(IRepository<ShiftDorm> repository)
        {
            _repository = repository;
        }

        public async Task<ShiftDorm> Handle(ShiftBackfillCommand request, CancellationToken cancellationToken)
        {
            var info = await _repository.GetAsync(request.Id);
            return info;
        }
    }
}
